home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume10 / contool / part01 next >
Encoding:
Internet Message Format  |  1990-10-29  |  49.8 KB

  1. Path: uunet!cs.utexas.edu!sun-barr!newstop!sun!melmac.harris-atd.com
  2. From: chuck@melmac.harris-atd.com (Chuck Musciano)
  3. Newsgroups: comp.sources.x
  4. Subject: v10i034: contool -- replacement for 'cmdtool -C', Part01/06
  5. Message-ID: <csx-10i034:contool@uunet.UU.NET>
  6. Date: 30 Oct 90 06:24:58 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 1524
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: news@trantor.harris-atd.com (News stuff)
  12. Posting-number: Volume 10, Issue 34
  13. Archive-name: contool/part01
  14.  
  15.      Contool is an alternate console window for workstations running
  16. X Windows.  It is known to run on all Sun workstations, and should function
  17. on other machines, too.
  18.  
  19.      Contool provides sophisticated console message filtering and alarm
  20. features.  Using regular expressions, you configure contool to detect and react
  21. to console messages.  Possible reactions include icon flashing, beeping,
  22. opening the window, logging the message, and executing any command.
  23.  
  24.      Contool uses dialog boxes to provide filter editing and tool property
  25. management.  It will work under and window manager, but runs best under
  26. olwm.
  27.  
  28.      You'll need X11r4 and XView 2.0, or Sun's OpenWindows 2.0, to build
  29. contool.
  30.  
  31.  
  32. Chuck Musciano                ARPA  : chuck@trantor.harris-atd.com
  33. Harris Corporation             Usenet: ...!uunet!x102a!trantor!chuck
  34. PO Box 37, MS 3A/1912            AT&T  : (407) 727-6131
  35. Melbourne, FL 32902            FAX   : (407) 729-2537
  36.  
  37. A good newspaper is never good enough,
  38.     but a lousy newspaper is a joy forever.        -- Garrison Keillor
  39.  
  40. #! /bin/sh
  41. # This is a shell archive.  Remove anything before this line, then unpack
  42. # it by saving it into a file and typing "sh file".  To overwrite existing
  43. # files, type "sh file -c".  You can also feed this as standard input via
  44. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  45. # will see the following message at the end:
  46. #        "End of archive 1 (of 6)."
  47. # Contents:  MANIFEST Makefile README contool.h error.c expand.c icons
  48. #   icons/default_bad.icon icons/default_flash.icon
  49. #   icons/default_good.icon icons/mask.icon images images/empty.icon
  50. #   images/range.icon images/single.icon load.c load_icon.c manifest.h
  51. #   patchlevel.h sample.filter window_misc.c
  52. # Wrapped by chuck@melmac on Fri Aug 17 10:00:50 1990
  53. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  54. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  55.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  56. else
  57. echo shar: Extracting \"'MANIFEST'\" \(1168 characters\)
  58. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  59. X   File Name        Archive #    Description
  60. X-----------------------------------------------------------
  61. X MANIFEST                   1    This shipping list
  62. X Makefile                   1    
  63. X README                     1    
  64. X contool.c                  4    
  65. X contool.h                  1    
  66. X contool.info               3    
  67. X contool.man                3    
  68. X contool_ui.c               6    
  69. X contool_ui.h               2    
  70. X error.c                    1    
  71. X expand.c                   1    
  72. X filters.c                  5    
  73. X icons                      1    
  74. X icons/default_bad.icon     1    
  75. X icons/default_flash.icon   1    
  76. X icons/default_good.icon    1    
  77. X icons/mask.icon            1    
  78. X images                     1    
  79. X images/empty.icon          1    
  80. X images/range.icon          1    
  81. X images/single.icon         1    
  82. X lex.c                      2    
  83. X load.c                     1    
  84. X load_icon.c                1    
  85. X logging.c                  2    
  86. X manifest.h                 1    
  87. X misc.c                     2    
  88. X parse.y                    2    
  89. X patchlevel.h               1    
  90. X props.c                    3    
  91. X regexp.c                   2    
  92. X sample.filter              1    
  93. X store.c                    2    
  94. X window_misc.c              1    
  95. END_OF_FILE
  96. if test 1168 -ne `wc -c <'MANIFEST'`; then
  97.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  98. fi
  99. # end of 'MANIFEST'
  100. fi
  101. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  102.   echo shar: Will not clobber existing file \"'Makefile'\"
  103. else
  104. echo shar: Extracting \"'Makefile'\" \(1800 characters\)
  105. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  106. X# Where to put the executable
  107. XBIN        = /usr/local/bin
  108. X
  109. X# Where to put the man page
  110. XMAN        = /usr/man/manl
  111. XMANEXT        = l
  112. X
  113. X# Where to install the help file
  114. XHELPDIR        = /usr/local/lib/help
  115. X
  116. X# paths to be searched for icons
  117. XICON_PATH    = .:./icons:/usr/local/images:/usr/include/images
  118. X
  119. X# Where you installed Open Windows
  120. XOPENWINHOME    = /usr/openwin
  121. X
  122. X# Where your XView libraries are installed
  123. XLDFLAGS        = -L$(OPENWINHOME)/lib
  124. X
  125. X# Where your XView include files are installed
  126. XCPPFLAGS    = -I$(OPENWINHOME)/include
  127. X
  128. XCONTOOL        = contool.o contool_ui.o error.o expand.o filters.o load.o load_icon.o logging.o misc.o parse.o props.o regexp.o store.o window_misc.o
  129. X
  130. XOPTIONS        = -O
  131. X
  132. XLDLIBS        = -lxview -lolgx -lX
  133. X
  134. X.c.o:
  135. X    cc $(OPTIONS) $(CPPFLAGS) -c $<
  136. X
  137. X.y.o:
  138. X    yacc $<
  139. X    cc $(OPTIONS) -c -o $*.o y.tab.c
  140. X    rm y.tab.c
  141. X
  142. Xcontool: $(CONTOOL)
  143. X    cc $(OPTIONS) -o contool $(CONTOOL) $(LDFLAGS) $(LDLIBS)
  144. X
  145. Xinstall: contool $(MAN)/contool.$(MANEXT)
  146. X    cp contool $(BIN)
  147. X    chmod 755 $(BIN)/contool
  148. X    cp contool.info $(HELPDIR)
  149. X
  150. X$(MAN)/contool.$(MANEXT): contool.man
  151. X    cp -p contool.man $(MAN)/contool.$(MANEXT)
  152. X
  153. Xclean:
  154. X    rm -f *~ $(OFILES) contool core
  155. X
  156. X#dependencies
  157. X
  158. Xcontool.o: manifest.h contool.h contool_ui.h icons/default_good.icon \
  159. X     icons/default_bad.icon icons/default_flash.icon icons/mask.icon
  160. X
  161. Xcontool_ui.o: contool_ui.h
  162. X
  163. Xerror.o: manifest.h contool_ui.h
  164. X
  165. Xexpand.o: manifest.h
  166. X
  167. Xfilters.o: manifest.h contool.h contool_ui.h images/single.icon \
  168. X     images/range.icon images/empty.icon
  169. X
  170. Xload.o: manifest.h contool.h contool_ui.h
  171. X
  172. Xload_icon.o: manifest.h contool.h
  173. X
  174. Xlogging.o: manifest.h contool.h contool_ui.h
  175. X
  176. Xmisc.o: manifest.h contool.h
  177. X
  178. Xparse.y: manifest.h contool.h lex.c
  179. X
  180. Xprops.o: manifest.h contool.h contool_ui.h
  181. X
  182. Xregexp.o: manifest.h contool.h
  183. X
  184. Xstore.o: manifest.h contool.h contool_ui.h
  185. X
  186. Xwindow_misc.o: manifest.h contool_ui.h
  187. END_OF_FILE
  188. if test 1800 -ne `wc -c <'Makefile'`; then
  189.     echo shar: \"'Makefile'\" unpacked with wrong size!
  190. fi
  191. # end of 'Makefile'
  192. fi
  193. if test -f 'README' -a "${1}" != "-c" ; then 
  194.   echo shar: Will not clobber existing file \"'README'\"
  195. else
  196. echo shar: Extracting \"'README'\" \(7305 characters\)
  197. sed "s/^X//" >'README' <<'END_OF_FILE'
  198. X/************************************************************************/
  199. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  200. X/*                                    */
  201. X/*    Permission to use, copy, modify, and distribute this software    */
  202. X/*    and its documentation for any purpose and without fee is    */
  203. X/*    hereby granted, provided that the above copyright notice    */
  204. X/*    appear in all copies and that both that copyright notice and    */
  205. X/*    this permission notice appear in supporting documentation, and    */
  206. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  207. X/*    used in advertising or publicity pertaining to distribution    */
  208. X/*    of the software without specific, written prior permission.    */
  209. X/*    Chuck Musciano and Harris Corporation make no representations    */
  210. X/*    about the suitability of this software for any purpose.  It is    */
  211. X/*    provided "as is" without express or implied warranty.  This     */
  212. X/*    software may not be sold without the prior explicit permission    */
  213. X/*    of Harris Corporation.                        */
  214. X/************************************************************************/
  215. X
  216. X     Contool Version 3.0
  217. X     
  218. X     Contool will capture and display system console messages with timestamps.
  219. XIt is a replacement for the standard Sun console, which is created with 
  220. X"cmdtool -C".  Contool will flash its icon and beep when messages are written
  221. Xto the icon, so you can keep it closed on your desktop until a message arrives.
  222. XYou can modify this beeping and flashing behavior; see the man page for more
  223. Xdetails.
  224. X
  225. X     You can instruct contool to filter and ignore certain common console
  226. Xmessages.  The man page explains how to create a file of filters in 
  227. X~/.contool; the included sample.filter is how my filters are set up.  You
  228. Xcan modify this to suit yourself, and copy it to ~/.contool.
  229. X
  230. X     This version of contool will only work with Open Windows 2.0, from Sun,
  231. Xor the XView 2.0 libraries available via anonymous FTP from expo.lcs.mit.edu.
  232. XIn either case, obviously, you'll need to be running some version of X Windows.
  233. X
  234. X     There are no plans to produce a SunView version of contool 3.0.
  235. X     
  236. X     Before building contool, you need to check several site dependencies
  237. Xin the Makefile.  These dependencies are:
  238. X
  239. X    In Makefile:
  240. X        BIN        Where the executable will go, normally
  241. X                /usr/local/bin
  242. X
  243. X        MANDIR        Where the man page will go, normally
  244. X                /usr/man/manl
  245. X
  246. X        MANEXT        The man page extension, usually 'l',
  247. X                for local man pages.  You may want to
  248. X                make MANDIR /usr/man/man1, in which case
  249. X                MANEXT should be '1'.
  250. X
  251. X        HELPDIR        Where the context-sensitive help file
  252. X                will be stored.
  253. X
  254. X        ICON_PATH    Path to search (at runtime) for other
  255. X                icon files.  This path will only be used
  256. X                if the user does not have the ICON_PATH
  257. X                environment variable defined.  Should
  258. X                consist of a various directories
  259. X                separated by colons.
  260. X
  261. X        OPENWINHOME    Where you installed Open Windows.
  262. X                Alternately, where you installed the
  263. X                XView toolkit shipped with X11R4.  Must
  264. X                be a directory with a child directory
  265. X                named "include" which contains X and
  266. X                XView include files.
  267. X
  268. X        LDFLAGS        Where ld can find your XView libraries.
  269. X                If you compile with Open Windows, the
  270. X                default value should be correct.  If you
  271. X                are using the X11 XView libraries, you
  272. X                may need to modify this value.
  273. X
  274. X        CPPFLAGS    Where cpp can find your XView include
  275. X                files.  If you compile with Open Windows,
  276. X                the default value should be correct.  If
  277. X                you are using the X11 XView toolkit, you
  278. X                may need to modify this value.
  279. X
  280. XOnce you have adjusted these values, just type "make contool" or "make
  281. Xinstall".  
  282. X
  283. X     Contool honors window command line options, described in xview(1),
  284. Xso you can change the default window size, icon position, etc.  We like
  285. Xto bring contool up closed, using "-Wi".
  286. X
  287. X     Comments, bugs, to me, please.  I would be very interested in your 
  288. Ximpressions of contool and any suggestions you might have to make it better.
  289. XBy the way, there are a few convenient untility routines in misc.c you might
  290. Xfind useful in other programs you are writing.
  291. X
  292. XChuck Musciano
  293. XAdvanced Technology Department
  294. XHarris Corporation
  295. XPO Box 37, MS 3A/1912
  296. XMelbourne, FL 32902
  297. X(407) 727-6131
  298. XARPA: chuck@trantor.harris-atd.com
  299. X
  300. X******************************** KNOWN XVIEW BUG ********************************
  301. X*                                        *
  302. X*      It is a known bug in XView that if you bring up a dialog box with the    *
  303. X* pushpin out (the default) and display a menu without selecting an item from    *
  304. X* the menu, the dialog box will be closed.  This can be demonstrated in contool    *
  305. X* by bringing up the edit filters window, and displaying the "edit" menu     *
  306. X* without selecting an action.                            *
  307. X*                                        *
  308. X*      This bug has been reported to Sun, but will not be fixed until version    *
  309. X* 3.0 of XView.                                    *
  310. X*                                        *
  311. X*********************************************************************************
  312. X
  313. X*********************************************************************************
  314. X*                Change history                    *
  315. X*********************************************************************************
  316. X
  317. X         1.0    20 Jun 88    Original release
  318. X         1.1    30 Jun 88    Added -p option to pop open when messages
  319. X                        arrive.  Suggested by Doug Lind
  320. X                        (lind@perron.ms.washington.edu).
  321. X                     Added alternate icon sets for more attractive
  322. X                        appearance when messages arrive.  Alternate
  323. X                        set two is from David Eckelcamp 
  324. X                        (eckelcamp@mcc.com).
  325. X                     Cleaned up Makefile.  Again, courtesy of
  326. X                        David Eckelcamp.
  327. X    2.0    23 Aug 88    Added automatic reload of filters when
  328. X                   filter file is modified.  Suggested by
  329. X                   Craig Musicant (cmusican@stanford.prime.com).
  330. X                Filter strings are now regular expressions.
  331. X                   Provided by jqj@hogg.cc.uoregon.edu.
  332. X                Reworked frame menu, based upon diffs posted
  333. X                   to sun-source@titan.rice.edu.
  334. X                Added protection from overflowing the text edit
  335. X                   window when too many messages arrive.
  336. X                Filters can now be read from any file, not
  337. X                   just ~/.contool.
  338. X    2.1    10 Feb 89    Added logging capability, courtesy of
  339. X                   Gregory Bond (gnb@melba.bby.oz.au).
  340. X    2.2    19 Sep 89    Added filter editing.
  341. X                Added icon pathname completion, courtesy of
  342. X                   Mike Arms (sandia!marms@unmvax.cs.unm.edu).
  343. X                Added moving the blinking icon to the front,
  344. X                   courtesy of Peter Lennevi
  345. X                   (etxlevi@solsta.ericsson.se).
  346. X                Changed icon loading to use ICON_PATH, and
  347. X                   supported ~ expansion, suggested by
  348. X                   Larry Virden (osu-cis!chemabs!lwv27).
  349. X                Fixed multiple message alert handling,
  350. X                   as suggested by Ellery Chan
  351. X                   (ellery@trantor.harris-atd.com).
  352. X    3.0     6 Jun 90    Ported to XView toolkit, running under
  353. X                   Open Windows 2.0.
  354. X                Reworked interface to be OPEN LOOK
  355. X                   compliant.
  356. X                Added saving of default actions to
  357. X                   filter file.
  358. X                Removed large number of command line
  359. X                   options in lieu of properties
  360. X                   dialog box.
  361. X                Added ability to associate a command
  362. X                   to be executed when a message arrives.
  363. X                Added explicit filter reset capability.
  364. X                Added the ability to print the contents
  365. X                   of the console.  Suggested by 
  366. X                   Danielle Heinzer
  367. X                   (ESC1298%ESOC.BITNET@cunyvm.cuny.edu).
  368. X                Reworked console overflow handling,
  369. X                   courtesy of Matt Cohen
  370. X                   (sysnmc@magic706.chron.com).
  371. END_OF_FILE
  372. if test 7305 -ne `wc -c <'README'`; then
  373.     echo shar: \"'README'\" unpacked with wrong size!
  374. fi
  375. # end of 'README'
  376. fi
  377. if test -f 'contool.h' -a "${1}" != "-c" ; then 
  378.   echo shar: Will not clobber existing file \"'contool.h'\"
  379. else
  380. echo shar: Extracting \"'contool.h'\" \(2263 characters\)
  381. sed "s/^X//" >'contool.h' <<'END_OF_FILE'
  382. X/************************************************************************/
  383. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  384. X/*                                    */
  385. X/*    Permission to use, copy, modify, and distribute this software    */
  386. X/*    and its documentation for any purpose and without fee is    */
  387. X/*    hereby granted, provided that the above copyright notice    */
  388. X/*    appear in all copies and that both that copyright notice and    */
  389. X/*    this permission notice appear in supporting documentation, and    */
  390. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  391. X/*    used in advertising or publicity pertaining to distribution    */
  392. X/*    of the software without specific, written prior permission.    */
  393. X/*    Chuck Musciano and Harris Corporation make no representations    */
  394. X/*    about the suitability of this software for any purpose.  It is    */
  395. X/*    provided "as is" without express or implied warranty.  This     */
  396. X/*    software may not be sold without the prior explicit permission    */
  397. X/*    of Harris Corporation.                        */
  398. X/************************************************************************/
  399. X
  400. X/************************************************************************/
  401. X/*                                    */
  402. X/*    contool.h    internal contool data structures        */
  403. X/*                                    */
  404. X/************************************************************************/
  405. X
  406. X#define        is_null(x)        ((x)? x : "")
  407. X
  408. X#define        BEEP_BIT        0x01
  409. X#define        COMMAND_BIT        0x02
  410. X#define        FLASH_BIT        0x04
  411. X#define        OPEN_BIT        0x08
  412. X#define        STAMP_BIT        0x10
  413. X
  414. Xtypedef    struct    filter    Filter;
  415. Xtypedef    struct    props    Props;
  416. X
  417. Xstruct    filter    {char    *start;
  418. X         char    *start_re;
  419. X         int    start_circf;
  420. X         char    *stop;
  421. X         char    *stop_re;
  422. X         int    stop_circf;
  423. X         char    *comment;
  424. X         int    save;
  425. X         int    beep;
  426. X         int    flash;
  427. X         int    open;
  428. X         int    stamp;
  429. X         char    *command;
  430. X         Filter    *next;
  431. X        };
  432. X
  433. Xstruct    props    {int    beep;
  434. X         int    flash;
  435. X         int    open;
  436. X         int    stamp;
  437. X         char    *command;
  438. X         char    *good_icon;
  439. X         char    *bad_icon;
  440. X         char    *flash_icon;
  441. X         char    *print_filter;
  442. X         char    *log_file;
  443. X         int    log_after;
  444. X         int    stamp_resolution;
  445. X         int    max_size;
  446. X         int    delete_amount;
  447. X        };
  448. X
  449. XPUBLIC    char    *compile_exp();
  450. XPUBLIC    char    *expand_tilde();
  451. X
  452. XPUBLIC    Props    defaults;
  453. XPUBLIC    Props    *parsed_defaults;
  454. XPUBLIC    Filter    *parsed_filters;
  455. XPUBLIC    Filter    *filters;
  456. XPUBLIC    int    parse_errors_occured;
  457. XPUBLIC    char    *filter_file;
  458. END_OF_FILE
  459. if test 2263 -ne `wc -c <'contool.h'`; then
  460.     echo shar: \"'contool.h'\" unpacked with wrong size!
  461. fi
  462. # end of 'contool.h'
  463. fi
  464. if test -f 'error.c' -a "${1}" != "-c" ; then 
  465.   echo shar: Will not clobber existing file \"'error.c'\"
  466. else
  467. echo shar: Extracting \"'error.c'\" \(2101 characters\)
  468. sed "s/^X//" >'error.c' <<'END_OF_FILE'
  469. X/************************************************************************/
  470. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  471. X/*                                    */
  472. X/*    Permission to use, copy, modify, and distribute this software    */
  473. X/*    and its documentation for any purpose and without fee is    */
  474. X/*    hereby granted, provided that the above copyright notice    */
  475. X/*    appear in all copies and that both that copyright notice and    */
  476. X/*    this permission notice appear in supporting documentation, and    */
  477. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  478. X/*    used in advertising or publicity pertaining to distribution    */
  479. X/*    of the software without specific, written prior permission.    */
  480. X/*    Chuck Musciano and Harris Corporation make no representations    */
  481. X/*    about the suitability of this software for any purpose.  It is    */
  482. X/*    provided "as is" without express or implied warranty.  This     */
  483. X/*    software may not be sold without the prior explicit permission    */
  484. X/*    of Harris Corporation.                        */
  485. X/************************************************************************/
  486. X
  487. X/************************************************************************/
  488. X/*                                    */
  489. X/*    error.c        handle error messages                */
  490. X/*                                    */
  491. X/************************************************************************/
  492. X
  493. X#include    <stdio.h>
  494. X#include    <xview/xview.h>
  495. X#include    <xview/notice.h>
  496. X
  497. X#include    "manifest.h"
  498. X#include    "contool_ui.h"
  499. X
  500. XPUBLIC    contool_base_objects    *contool_base;
  501. X
  502. X/************************************************************************/
  503. XPRIVATE    void    show_error(msg)
  504. X
  505. Xchar    *msg;
  506. X
  507. X{
  508. X    notice_prompt(contool_base->base, NULL,
  509. X                 NOTICE_MESSAGE_STRINGS, msg, 0,
  510. X                 NOTICE_BUTTON_YES, "OK",
  511. X              0);
  512. X}
  513. X
  514. X/************************************************************************/
  515. XEXPORT    void    error(a, b, c, d, e, f)
  516. X
  517. Xchar    *a, *b, *c, *d, *e, *f;
  518. X
  519. X{    char    buf[1024];
  520. X
  521. X    sprintf(buf, a, b, c, d, e, f);
  522. X    show_error(buf);
  523. X}
  524. X
  525. X/************************************************************************/
  526. XEXPORT    void    abend(a, b, c, d, e, f)
  527. X
  528. Xchar    *a, *b, *c, *d, *e, *f;
  529. X
  530. X{
  531. X    error(a, b, c, d, e, f);
  532. X    exit(1);
  533. X}
  534. END_OF_FILE
  535. if test 2101 -ne `wc -c <'error.c'`; then
  536.     echo shar: \"'error.c'\" unpacked with wrong size!
  537. fi
  538. # end of 'error.c'
  539. fi
  540. if test -f 'expand.c' -a "${1}" != "-c" ; then 
  541.   echo shar: Will not clobber existing file \"'expand.c'\"
  542. else
  543. echo shar: Extracting \"'expand.c'\" \(3088 characters\)
  544. sed "s/^X//" >'expand.c' <<'END_OF_FILE'
  545. X/************************************************************************/
  546. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  547. X/*                                    */
  548. X/*    Permission to use, copy, modify, and distribute this software    */
  549. X/*    and its documentation for any purpose and without fee is    */
  550. X/*    hereby granted, provided that the above copyright notice    */
  551. X/*    appear in all copies and that both that copyright notice and    */
  552. X/*    this permission notice appear in supporting documentation, and    */
  553. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  554. X/*    used in advertising or publicity pertaining to distribution    */
  555. X/*    of the software without specific, written prior permission.    */
  556. X/*    Chuck Musciano and Harris Corporation make no representations    */
  557. X/*    about the suitability of this software for any purpose.  It is    */
  558. X/*    provided "as is" without express or implied warranty.  This     */
  559. X/*    software may not be sold without the prior explicit permission    */
  560. X/*    of Harris Corporation.                        */
  561. X/************************************************************************/
  562. X
  563. X#include    <sys/types.h>
  564. X#include    <sys/dir.h>
  565. X#include    <pwd.h>
  566. X
  567. X#include    "manifest.h"
  568. X
  569. XPUBLIC    char    *rindex(), *index();
  570. X
  571. X/************************************************************************/
  572. XPRIVATE    char    *root_path(path)
  573. X
  574. Xchar    *path;
  575. X
  576. X{    char    *p;
  577. X
  578. X    if (p = rindex(path, '/'))
  579. X       if (p == path)
  580. X          p[1] = '\0';
  581. X       else
  582. X          *p = '\0';
  583. X    else
  584. X       *path = '\0';
  585. X    return(path);
  586. X}
  587. X
  588. X/************************************************************************/
  589. XPRIVATE    char    *last_node(path)
  590. X
  591. Xchar    *path;
  592. X
  593. X{    char    *p;
  594. X
  595. X    return((p = rindex(path, '/'))? p + 1 : path);
  596. X}
  597. X
  598. X/************************************************************************/
  599. XEXPORT    char    *expand_filename(path)
  600. X
  601. Xchar    *path;
  602. X
  603. X{    static    char    s[1024];
  604. X    char    pattern[1024], candidate[1024], *p,*q;
  605. X    DIR    *dir;
  606. X    struct    direct *dp;
  607. X    struct    passwd    *pw;
  608. X
  609. X    strcpy(s, path);
  610. X    if (*path == '~')
  611. X       if (path[1] == '/' || path[1] == '\0') {
  612. X          strcpy(s, getenv("HOME"));
  613. X          strcat(s, path + 1);
  614. X          }
  615. X       else {
  616. X          if ((p = index(path, '/')) != NULL)
  617. X             *p = '\0';
  618. X          if ((pw = getpwnam(path + 1)) != NULL) {
  619. X             strcpy(s, pw->pw_dir);
  620. X             if (p != NULL) {
  621. X                strcat(s, "/");
  622. X                strcat(s, p + 1);
  623. X                }
  624. X             }
  625. X          else
  626. X             return(NULL);
  627. X          }
  628. X    strcpy(pattern, last_node(s));
  629. X    if (*pattern == '\0')
  630. X       return(s);
  631. X    root_path(s);
  632. X    candidate[0] = '\0';
  633. X    if (*s == '\0')
  634. X       strcpy(s, ".");
  635. X    if ((dir = opendir(s)) == NULL) {
  636. X       strcpy(s, path);
  637. X       return(s);
  638. X       }
  639. X    while ((dp = readdir(dir)) != NULL)
  640. X       if (strncmp(dp->d_name, pattern, strlen(pattern)) == 0)
  641. X          if (*candidate == '\0')
  642. X             strcpy(candidate, dp->d_name);
  643. X          else {
  644. X             for (p = candidate, q = dp->d_name; *p == *q; p++, q++)
  645. X                ;
  646. X             *p = '\0';
  647. X             }
  648. X    closedir(dir);
  649. X    if (*candidate == '\0')
  650. X       return(NULL);
  651. X    else {
  652. X       if (strcmp(s, ".") == 0)
  653. X          *s = '\0';
  654. X       else if (s[strlen(s) - 1] != '/')
  655. X          strcat(s, "/");
  656. X       strcat(s, candidate);
  657. X       }
  658. X    return(s);
  659. X}
  660. END_OF_FILE
  661. if test 3088 -ne `wc -c <'expand.c'`; then
  662.     echo shar: \"'expand.c'\" unpacked with wrong size!
  663. fi
  664. # end of 'expand.c'
  665. fi
  666. if test ! -d 'icons' ; then
  667.     echo shar: Creating directory \"'icons'\"
  668.     mkdir 'icons'
  669. fi
  670. if test -f 'icons/default_bad.icon' -a "${1}" != "-c" ; then 
  671.   echo shar: Will not clobber existing file \"'icons/default_bad.icon'\"
  672. else
  673. echo shar: Extracting \"'icons/default_bad.icon'\" \(1997 characters\)
  674. sed "s/^X//" >'icons/default_bad.icon' <<'END_OF_FILE'
  675. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  676. X */
  677. X    0x0000,0x0000,0x0000,0x0000,
  678. X    0x0000,0x0000,0x0000,0x0000,
  679. X    0x0000,0x0000,0x0000,0x0000,
  680. X    0x0000,0x0000,0x0000,0x0000,
  681. X    0x0000,0x0000,0x0000,0x0000,
  682. X    0x0000,0x0000,0x0000,0x0000,
  683. X    0x0000,0x0000,0x0000,0x0000,
  684. X    0x0000,0xFFFF,0xFFFE,0x0000,
  685. X    0x0001,0xFFFF,0xFFFF,0x0000,
  686. X    0x0001,0x8000,0x0003,0x0000,
  687. X    0x0001,0xBFFF,0xFFFB,0x0000,
  688. X    0x0001,0xBFFF,0xFFFB,0x0000,
  689. X    0x0001,0xBFFF,0xFFFB,0x0000,
  690. X    0x0001,0xBFFF,0xFFFB,0x0000,
  691. X    0x0001,0xBFFF,0xFFFB,0x0000,
  692. X    0x0001,0xBFFF,0xFFFB,0x0000,
  693. X    0x0001,0xBFFF,0xFFFB,0x0000,
  694. X    0x0001,0xBFFF,0xFFFB,0x0000,
  695. X    0x0001,0xBFFF,0xFFFB,0x0000,
  696. X    0x0001,0xBFFF,0xFFFB,0x0000,
  697. X    0x0001,0xBFFF,0xFFFB,0x0000,
  698. X    0x0001,0xBFFF,0xFFFB,0x0000,
  699. X    0x0001,0xBFFF,0xFFFB,0x0000,
  700. X    0x0001,0xBFFF,0xFFFB,0x0000,
  701. X    0x0001,0xBFFF,0xFFFB,0x0000,
  702. X    0x0001,0xBFFF,0xFFFB,0x0000,
  703. X    0x0001,0xBFFF,0xFFFB,0x0000,
  704. X    0x0001,0xBFFF,0xFFFB,0x0000,
  705. X    0x0001,0xBFFF,0xFFFB,0x0000,
  706. X    0x0001,0x8000,0x0003,0x0000,
  707. X    0x0001,0xFFFF,0xFFFF,0x0000,
  708. X    0x0000,0xFFFF,0xFFFE,0x0000,
  709. X    0x0000,0x0000,0x0000,0x0000,
  710. X    0x0000,0x0000,0x0000,0x0000,
  711. X    0x000F,0xFFFF,0xFFFF,0xE000,
  712. X    0x0018,0x0000,0x0000,0x3000,
  713. X    0x0031,0x5555,0x5555,0x1800,
  714. X    0x0062,0xAAAA,0xAAAA,0x8C00,
  715. X    0x00C5,0x5555,0x5555,0x4600,
  716. X    0x00C0,0x0000,0x0000,0x0600,
  717. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  718. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  719. X    0x0000,0x0000,0x0000,0x0000,
  720. X    0x0000,0x0000,0x0000,0x0000,
  721. X    0x0000,0x0000,0x0000,0x0000,
  722. X    0x0000,0x0000,0x0000,0x0000,
  723. X    0x0000,0x0000,0x0000,0x0000,
  724. X    0x0000,0x0000,0x0000,0x0000,
  725. X    0x0000,0x0000,0x0000,0x0000,
  726. X    0x0000,0x0000,0x0004,0x0000,
  727. X    0x0000,0x0000,0x0004,0x0000,
  728. X    0x0000,0x0000,0x0004,0x0000,
  729. X    0x000E,0x30B0,0xE184,0x7000,
  730. X    0x0010,0x48C9,0x0244,0x8800,
  731. X    0x0020,0x8489,0x0424,0x8800,
  732. X    0x0020,0x8488,0xC424,0xF800,
  733. X    0x0020,0x8488,0x2424,0x8000,
  734. X    0x0010,0x4888,0x2244,0x8800,
  735. X    0x000E,0x3089,0xC184,0x7000,
  736. X    0x0000,0x0000,0x0000,0x0000,
  737. X    0x0000,0x0000,0x0000,0x0000,
  738. X    0x0000,0x0000,0x0000,0x0000,
  739. X    0x0000,0x0000,0x0000,0x0000,
  740. X    0x0000,0x0000,0x0000,0x0000
  741. END_OF_FILE
  742. if test 1997 -ne `wc -c <'icons/default_bad.icon'`; then
  743.     echo shar: \"'icons/default_bad.icon'\" unpacked with wrong size!
  744. fi
  745. # end of 'icons/default_bad.icon'
  746. fi
  747. if test -f 'icons/default_flash.icon' -a "${1}" != "-c" ; then 
  748.   echo shar: Will not clobber existing file \"'icons/default_flash.icon'\"
  749. else
  750. echo shar: Extracting \"'icons/default_flash.icon'\" \(1997 characters\)
  751. sed "s/^X//" >'icons/default_flash.icon' <<'END_OF_FILE'
  752. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  753. X */
  754. X    0x0000,0x0000,0x0000,0x0000,
  755. X    0x0000,0x0000,0x0000,0x0000,
  756. X    0x0000,0x0000,0x0000,0x0000,
  757. X    0x0000,0x0000,0x0000,0x0000,
  758. X    0x0000,0x0000,0x0000,0x0000,
  759. X    0x0000,0x0000,0x0000,0x0000,
  760. X    0x0000,0x0000,0x0000,0x0000,
  761. X    0x0000,0xFFFF,0xFFFE,0x0000,
  762. X    0x0001,0xFFFF,0xFFFF,0x0000,
  763. X    0x0001,0x8000,0x0003,0x0000,
  764. X    0x0001,0xBFFF,0xFFFB,0x0000,
  765. X    0x0001,0xA000,0x000B,0x0000,
  766. X    0x0001,0xA000,0x000B,0x0000,
  767. X    0x0001,0xA000,0x000B,0x0000,
  768. X    0x0001,0xA000,0x000B,0x0000,
  769. X    0x0001,0xA000,0x000B,0x0000,
  770. X    0x0001,0xA000,0x000B,0x0000,
  771. X    0x0001,0xA000,0x000B,0x0000,
  772. X    0x0001,0xA000,0x000B,0x0000,
  773. X    0x0001,0xA000,0x000B,0x0000,
  774. X    0x0001,0xA000,0x000B,0x0000,
  775. X    0x0001,0xA000,0x000B,0x0000,
  776. X    0x0001,0xA000,0x000B,0x0000,
  777. X    0x0001,0xA000,0x000B,0x0000,
  778. X    0x0001,0xA000,0x000B,0x0000,
  779. X    0x0001,0xA000,0x000B,0x0000,
  780. X    0x0001,0xA000,0x000B,0x0000,
  781. X    0x0001,0xA000,0x000B,0x0000,
  782. X    0x0001,0xBFFF,0xFFFB,0x0000,
  783. X    0x0001,0x8000,0x0003,0x0000,
  784. X    0x0001,0xFFFF,0xFFFF,0x0000,
  785. X    0x0000,0xFFFF,0xFFFE,0x0000,
  786. X    0x0000,0x0000,0x0000,0x0000,
  787. X    0x0000,0x0000,0x0000,0x0000,
  788. X    0x000F,0xFFFF,0xFFFF,0xE000,
  789. X    0x0018,0x0000,0x0000,0x3000,
  790. X    0x0031,0x5555,0x5555,0x1800,
  791. X    0x0062,0xAAAA,0xAAAA,0x8C00,
  792. X    0x00C5,0x5555,0x5555,0x4600,
  793. X    0x00C0,0x0000,0x0000,0x0600,
  794. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  795. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  796. X    0x0000,0x0000,0x0000,0x0000,
  797. X    0x0000,0x0000,0x0000,0x0000,
  798. X    0x0000,0x0000,0x0000,0x0000,
  799. X    0x0000,0x0000,0x0000,0x0000,
  800. X    0x0000,0x0000,0x0000,0x0000,
  801. X    0x0000,0x0000,0x0000,0x0000,
  802. X    0x0000,0x0000,0x0000,0x0000,
  803. X    0x0000,0x0000,0x0004,0x0000,
  804. X    0x0000,0x0000,0x0004,0x0000,
  805. X    0x0000,0x0000,0x0004,0x0000,
  806. X    0x000E,0x30B0,0xE184,0x7000,
  807. X    0x0010,0x48C9,0x0244,0x8800,
  808. X    0x0020,0x8489,0x0424,0x8800,
  809. X    0x0020,0x8488,0xC424,0xF800,
  810. X    0x0020,0x8488,0x2424,0x8000,
  811. X    0x0010,0x4888,0x2244,0x8800,
  812. X    0x000E,0x3089,0xC184,0x7000,
  813. X    0x0000,0x0000,0x0000,0x0000,
  814. X    0x0000,0x0000,0x0000,0x0000,
  815. X    0x0000,0x0000,0x0000,0x0000,
  816. X    0x0000,0x0000,0x0000,0x0000,
  817. X    0x0000,0x0000,0x0000,0x0000
  818. END_OF_FILE
  819. if test 1997 -ne `wc -c <'icons/default_flash.icon'`; then
  820.     echo shar: \"'icons/default_flash.icon'\" unpacked with wrong size!
  821. fi
  822. # end of 'icons/default_flash.icon'
  823. fi
  824. if test -f 'icons/default_good.icon' -a "${1}" != "-c" ; then 
  825.   echo shar: Will not clobber existing file \"'icons/default_good.icon'\"
  826. else
  827. echo shar: Extracting \"'icons/default_good.icon'\" \(1997 characters\)
  828. sed "s/^X//" >'icons/default_good.icon' <<'END_OF_FILE'
  829. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  830. X */
  831. X    0x0000,0x0000,0x0000,0x0000,
  832. X    0x0000,0x0000,0x0000,0x0000,
  833. X    0x0000,0x0000,0x0000,0x0000,
  834. X    0x0000,0x0000,0x0000,0x0000,
  835. X    0x0000,0x0000,0x0000,0x0000,
  836. X    0x0000,0x0000,0x0000,0x0000,
  837. X    0x0000,0x0000,0x0000,0x0000,
  838. X    0x0000,0xFFFF,0xFFFE,0x0000,
  839. X    0x0001,0xFFFF,0xFFFF,0x0000,
  840. X    0x0001,0x8000,0x0003,0x0000,
  841. X    0x0001,0xBFFF,0xFFFB,0x0000,
  842. X    0x0001,0xB555,0x555B,0x0000,
  843. X    0x0001,0xAAAA,0xAAAB,0x0000,
  844. X    0x0001,0xB555,0x555B,0x0000,
  845. X    0x0001,0xAAAA,0xA02B,0x0000,
  846. X    0x0001,0xB555,0x505B,0x0000,
  847. X    0x0001,0xAAAA,0xA02B,0x0000,
  848. X    0x0001,0xB555,0x505B,0x0000,
  849. X    0x0001,0xAAAA,0xA02B,0x0000,
  850. X    0x0001,0xB555,0x555B,0x0000,
  851. X    0x0001,0xAAAA,0xAAAB,0x0000,
  852. X    0x0001,0xB555,0x555B,0x0000,
  853. X    0x0001,0xAAAA,0xAAAB,0x0000,
  854. X    0x0001,0xB555,0x555B,0x0000,
  855. X    0x0001,0xAAAA,0xAAAB,0x0000,
  856. X    0x0001,0xB555,0x555B,0x0000,
  857. X    0x0001,0xAAAA,0xAAAB,0x0000,
  858. X    0x0001,0xB555,0x555B,0x0000,
  859. X    0x0001,0xBFFF,0xFFFB,0x0000,
  860. X    0x0001,0x8000,0x0003,0x0000,
  861. X    0x0001,0xFFFF,0xFFFF,0x0000,
  862. X    0x0000,0xFFFF,0xFFFE,0x0000,
  863. X    0x0000,0x0000,0x0000,0x0000,
  864. X    0x0000,0x0000,0x0000,0x0000,
  865. X    0x000F,0xFFFF,0xFFFF,0xE000,
  866. X    0x0018,0x0000,0x0000,0x3000,
  867. X    0x0031,0x5555,0x5555,0x1800,
  868. X    0x0062,0xAAAA,0xAAAA,0x8C00,
  869. X    0x00C5,0x5555,0x5555,0x4600,
  870. X    0x00C0,0x0000,0x0000,0x0600,
  871. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  872. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  873. X    0x0000,0x0000,0x0000,0x0000,
  874. X    0x0000,0x0000,0x0000,0x0000,
  875. X    0x0000,0x0000,0x0000,0x0000,
  876. X    0x0000,0x0000,0x0000,0x0000,
  877. X    0x0000,0x0000,0x0000,0x0000,
  878. X    0x0000,0x0000,0x0000,0x0000,
  879. X    0x0000,0x0000,0x0000,0x0000,
  880. X    0x0000,0x0000,0x0004,0x0000,
  881. X    0x0000,0x0000,0x0004,0x0000,
  882. X    0x0000,0x0000,0x0004,0x0000,
  883. X    0x000E,0x30B0,0xE184,0x7000,
  884. X    0x0010,0x48C9,0x0244,0x8800,
  885. X    0x0020,0x8489,0x0424,0x8800,
  886. X    0x0020,0x8488,0xC424,0xF800,
  887. X    0x0020,0x8488,0x2424,0x8000,
  888. X    0x0010,0x4888,0x2244,0x8800,
  889. X    0x000E,0x3089,0xC184,0x7000,
  890. X    0x0000,0x0000,0x0000,0x0000,
  891. X    0x0000,0x0000,0x0000,0x0000,
  892. X    0x0000,0x0000,0x0000,0x0000,
  893. X    0x0000,0x0000,0x0000,0x0000,
  894. X    0x0000,0x0000,0x0000,0x0000
  895. END_OF_FILE
  896. if test 1997 -ne `wc -c <'icons/default_good.icon'`; then
  897.     echo shar: \"'icons/default_good.icon'\" unpacked with wrong size!
  898. fi
  899. # end of 'icons/default_good.icon'
  900. fi
  901. if test -f 'icons/mask.icon' -a "${1}" != "-c" ; then 
  902.   echo shar: Will not clobber existing file \"'icons/mask.icon'\"
  903. else
  904. echo shar: Extracting \"'icons/mask.icon'\" \(1997 characters\)
  905. sed "s/^X//" >'icons/mask.icon' <<'END_OF_FILE'
  906. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  907. X */
  908. X    0x0000,0x0000,0x0000,0x0000,
  909. X    0x0000,0x0000,0x0000,0x0000,
  910. X    0x0000,0x0000,0x0000,0x0000,
  911. X    0x0000,0x0000,0x0000,0x0000,
  912. X    0x0000,0x0000,0x0000,0x0000,
  913. X    0x0000,0x0000,0x0000,0x0000,
  914. X    0x0000,0x0000,0x0000,0x0000,
  915. X    0x0000,0xFFFF,0xFFFE,0x0000,
  916. X    0x0001,0xFFFF,0xFFFF,0x0000,
  917. X    0x0001,0xFFFF,0xFFFF,0x0000,
  918. X    0x0001,0xFFFF,0xFFFF,0x0000,
  919. X    0x0001,0xFFFF,0xFFFF,0x0000,
  920. X    0x0001,0xFFFF,0xFFFF,0x0000,
  921. X    0x0001,0xFFFF,0xFFFF,0x0000,
  922. X    0x0001,0xFFFF,0xFFFF,0x0000,
  923. X    0x0001,0xFFFF,0xFFFF,0x0000,
  924. X    0x0001,0xFFFF,0xFFFF,0x0000,
  925. X    0x0001,0xFFFF,0xFFFF,0x0000,
  926. X    0x0001,0xFFFF,0xFFFF,0x0000,
  927. X    0x0001,0xFFFF,0xFFFF,0x0000,
  928. X    0x0001,0xFFFF,0xFFFF,0x0000,
  929. X    0x0001,0xFFFF,0xFFFF,0x0000,
  930. X    0x0001,0xFFFF,0xFFFF,0x0000,
  931. X    0x0001,0xFFFF,0xFFFF,0x0000,
  932. X    0x0001,0xFFFF,0xFFFF,0x0000,
  933. X    0x0001,0xFFFF,0xFFFF,0x0000,
  934. X    0x0001,0xFFFF,0xFFFF,0x0000,
  935. X    0x0001,0xFFFF,0xFFFF,0x0000,
  936. X    0x0001,0xFFFF,0xFFFF,0x0000,
  937. X    0x0001,0xFFFF,0xFFFF,0x0000,
  938. X    0x0001,0xFFFF,0xFFFF,0x0000,
  939. X    0x0000,0xFFFF,0xFFFE,0x0000,
  940. X    0x0000,0x0000,0x0000,0x0000,
  941. X    0x0000,0x0000,0x0000,0x0000,
  942. X    0x000F,0xFFFF,0xFFFF,0xE000,
  943. X    0x001F,0xFFFF,0xFFFF,0xF000,
  944. X    0x003F,0xFFFF,0xFFFF,0xF800,
  945. X    0x007F,0xFFFF,0xFFFF,0xFC00,
  946. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  947. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  948. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  949. X    0x00FF,0xFFFF,0xFFFF,0xFE00,
  950. X    0x0000,0x0000,0x0000,0x0000,
  951. X    0x0000,0x0000,0x0000,0x0000,
  952. X    0x0000,0x0000,0x0000,0x0000,
  953. X    0x0000,0x0000,0x0000,0x0000,
  954. X    0x0000,0x0000,0x0000,0x0000,
  955. X    0x0000,0x0000,0x0000,0x0000,
  956. X    0x0000,0x0000,0x0000,0x0000,
  957. X    0x0000,0x0000,0x0004,0x0000,
  958. X    0x0000,0x0000,0x0004,0x0000,
  959. X    0x0000,0x0000,0x0004,0x0000,
  960. X    0x000E,0x30B0,0xE184,0x7000,
  961. X    0x0010,0x48C9,0x0244,0x8800,
  962. X    0x0020,0x8489,0x0424,0x8800,
  963. X    0x0020,0x8488,0xC424,0xF800,
  964. X    0x0020,0x8488,0x2424,0x8000,
  965. X    0x0010,0x4888,0x2244,0x8800,
  966. X    0x000E,0x3089,0xC184,0x7000,
  967. X    0x0000,0x0000,0x0000,0x0000,
  968. X    0x0000,0x0000,0x0000,0x0000,
  969. X    0x0000,0x0000,0x0000,0x0000,
  970. X    0x0000,0x0000,0x0000,0x0000,
  971. X    0x0000,0x0000,0x0000,0x0000
  972. END_OF_FILE
  973. if test 1997 -ne `wc -c <'icons/mask.icon'`; then
  974.     echo shar: \"'icons/mask.icon'\" unpacked with wrong size!
  975. fi
  976. # end of 'icons/mask.icon'
  977. fi
  978. if test ! -d 'images' ; then
  979.     echo shar: Creating directory \"'images'\"
  980.     mkdir 'images'
  981. fi
  982. if test -f 'images/empty.icon' -a "${1}" != "-c" ; then 
  983.   echo shar: Will not clobber existing file \"'images/empty.icon'\"
  984. else
  985. echo shar: Extracting \"'images/empty.icon'\" \(193 characters\)
  986. sed "s/^X//" >'images/empty.icon' <<'END_OF_FILE'
  987. X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
  988. X */
  989. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  990. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
  991. END_OF_FILE
  992. if test 193 -ne `wc -c <'images/empty.icon'`; then
  993.     echo shar: \"'images/empty.icon'\" unpacked with wrong size!
  994. fi
  995. # end of 'images/empty.icon'
  996. fi
  997. if test -f 'images/range.icon' -a "${1}" != "-c" ; then 
  998.   echo shar: Will not clobber existing file \"'images/range.icon'\"
  999. else
  1000. echo shar: Extracting \"'images/range.icon'\" \(193 characters\)
  1001. sed "s/^X//" >'images/range.icon' <<'END_OF_FILE'
  1002. X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
  1003. X */
  1004. X    0x9440,0xBF68,0x0000,0x8000,0xF6DE,0x0000,0x8A22,0xDFBB,
  1005. X    0x0000,0xA100,0xBBB6,0x0000,0x8824,0xEDB7,0x0000,0x0000
  1006. END_OF_FILE
  1007. if test 193 -ne `wc -c <'images/range.icon'`; then
  1008.     echo shar: \"'images/range.icon'\" unpacked with wrong size!
  1009. fi
  1010. # end of 'images/range.icon'
  1011. fi
  1012. if test -f 'images/single.icon' -a "${1}" != "-c" ; then 
  1013.   echo shar: Will not clobber existing file \"'images/single.icon'\"
  1014. else
  1015. echo shar: Extracting \"'images/single.icon'\" \(193 characters\)
  1016. sed "s/^X//" >'images/single.icon' <<'END_OF_FILE'
  1017. X/* Format_version=1, Width=16, Height=16, Depth=1, Valid_bits_per_item=16
  1018. X */
  1019. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x8A22,0xDFBB,
  1020. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
  1021. END_OF_FILE
  1022. if test 193 -ne `wc -c <'images/single.icon'`; then
  1023.     echo shar: \"'images/single.icon'\" unpacked with wrong size!
  1024. fi
  1025. # end of 'images/single.icon'
  1026. fi
  1027. if test -f 'load.c' -a "${1}" != "-c" ; then 
  1028.   echo shar: Will not clobber existing file \"'load.c'\"
  1029. else
  1030. echo shar: Extracting \"'load.c'\" \(3321 characters\)
  1031. sed "s/^X//" >'load.c' <<'END_OF_FILE'
  1032. X/************************************************************************/
  1033. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  1034. X/*                                    */
  1035. X/*    Permission to use, copy, modify, and distribute this software    */
  1036. X/*    and its documentation for any purpose and without fee is    */
  1037. X/*    hereby granted, provided that the above copyright notice    */
  1038. X/*    appear in all copies and that both that copyright notice and    */
  1039. X/*    this permission notice appear in supporting documentation, and    */
  1040. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  1041. X/*    used in advertising or publicity pertaining to distribution    */
  1042. X/*    of the software without specific, written prior permission.    */
  1043. X/*    Chuck Musciano and Harris Corporation make no representations    */
  1044. X/*    about the suitability of this software for any purpose.  It is    */
  1045. X/*    provided "as is" without express or implied warranty.  This     */
  1046. X/*    software may not be sold without the prior explicit permission    */
  1047. X/*    of Harris Corporation.                        */
  1048. X/************************************************************************/
  1049. X
  1050. X/************************************************************************/
  1051. X/*                                    */
  1052. X/*    load.c        contool load dialog manager            */
  1053. X/*                                    */
  1054. X/************************************************************************/
  1055. X
  1056. X#include    <stdio.h>
  1057. X#include    <sys/param.h>
  1058. X#include    <sys/types.h>
  1059. X#include    <xview/xview.h>
  1060. X#include    <xview/panel.h>
  1061. X#include    <xview/xv_xrect.h>
  1062. X
  1063. X#include    "manifest.h"
  1064. X#include    "contool.h"
  1065. X#include    "contool_ui.h"
  1066. X
  1067. XPRIVATE    contool_load_objects    *contool_load = NULL;
  1068. X
  1069. X/************************************************************************/
  1070. XEXPORT    Menu_item    popup_load_config(item, op)
  1071. X
  1072. XMenu_item    item;
  1073. XMenu_generate    op;
  1074. X
  1075. X{    contool_base_objects * ip = (contool_base_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1076. X
  1077. X    if (op == MENU_NOTIFY) {
  1078. X       if (contool_load == NULL) {
  1079. X          contool_load = contool_load_objects_initialize(NULL, ip->base);
  1080. X          xv_set(contool_load->load_file,
  1081. X                      PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  1082. X                      PANEL_NOTIFY_STRING, "\n\r ",
  1083. X                   NULL);
  1084. X          xv_set(contool_load->load_type, PANEL_VALUE, 3, NULL);
  1085. X          place_dialog(ip->base, contool_load->load);
  1086. X          }
  1087. X       xv_set(contool_load->load_file, PANEL_VALUE, filter_file, NULL);
  1088. X       xv_set(contool_load->load, XV_SHOW, TRUE, NULL);
  1089. X       }
  1090. X    return item;
  1091. X}
  1092. X
  1093. X/************************************************************************/
  1094. XEXPORT    void    load_filters(item, event)
  1095. X
  1096. XPanel_item    item;
  1097. XEvent        *event;
  1098. X
  1099. X{    contool_load_objects    *ip = (contool_load_objects *) xv_get(item, XV_KEY_DATA, INSTANCE);
  1100. X    int    kind;
  1101. X    char    *path;
  1102. X
  1103. X    path = expand_tilde(xv_get(ip->load_file, PANEL_VALUE));
  1104. X    if (lex_init(path)) {
  1105. X       yyparse();
  1106. X       if (parse_errors_occured) {
  1107. X          error("Error in configuration file.  Configuration not loaded");
  1108. X          xv_set(ip->accept_load, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  1109. X          }
  1110. X       else {
  1111. X          kind = (int) xv_get(ip->load_type, PANEL_VALUE);
  1112. X          if (kind & 1 && parsed_defaults)
  1113. X             defaults = *parsed_defaults;
  1114. X          if (kind & 2)
  1115. X             filters = parsed_filters;
  1116. X          free(parsed_defaults);
  1117. X          filter_file = path;
  1118. X          }
  1119. X       }
  1120. X    else {
  1121. X       error("Unable to read configuration file");
  1122. X       xv_set(ip->accept_load, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  1123. X       free(path);
  1124. X       }
  1125. X}
  1126. END_OF_FILE
  1127. if test 3321 -ne `wc -c <'load.c'`; then
  1128.     echo shar: \"'load.c'\" unpacked with wrong size!
  1129. fi
  1130. # end of 'load.c'
  1131. fi
  1132. if test -f 'load_icon.c' -a "${1}" != "-c" ; then 
  1133.   echo shar: Will not clobber existing file \"'load_icon.c'\"
  1134. else
  1135. echo shar: Extracting \"'load_icon.c'\" \(2086 characters\)
  1136. sed "s/^X//" >'load_icon.c' <<'END_OF_FILE'
  1137. X/************************************************************************/
  1138. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  1139. X/*                                    */
  1140. X/*    Permission to use, copy, modify, and distribute this software    */
  1141. X/*    and its documentation for any purpose and without fee is    */
  1142. X/*    hereby granted, provided that the above copyright notice    */
  1143. X/*    appear in all copies and that both that copyright notice and    */
  1144. X/*    this permission notice appear in supporting documentation, and    */
  1145. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  1146. X/*    used in advertising or publicity pertaining to distribution    */
  1147. X/*    of the software without specific, written prior permission.    */
  1148. X/*    Chuck Musciano and Harris Corporation make no representations    */
  1149. X/*    about the suitability of this software for any purpose.  It is    */
  1150. X/*    provided "as is" without express or implied warranty.  This     */
  1151. X/*    software may not be sold without the prior explicit permission    */
  1152. X/*    of Harris Corporation.                        */
  1153. X/************************************************************************/
  1154. X
  1155. X#include    <stdio.h>
  1156. X#include    <sys/file.h>
  1157. X
  1158. X#include    <xview/xview.h>
  1159. X#include    <xview/icon_load.h>
  1160. X
  1161. X#include    "manifest.h"
  1162. X#include    "contool.h"
  1163. X
  1164. XPUBLIC    char    *getenv();
  1165. X
  1166. X/************************************************************************/
  1167. XEXPORT    Server_image    load_icon(path, message)
  1168. X
  1169. Xchar    *path;
  1170. Xchar    *message;
  1171. X
  1172. X{    char    *icon_path, new_path[1024], *p, *q;
  1173. X
  1174. X    if (*path == '/')
  1175. X       return(icon_load_svrim(path, message));
  1176. X    else {
  1177. X       if ((p = getenv("ICON_PATH")) != NULL)
  1178. X          icon_path = strsave(p);
  1179. X       else
  1180. X          icon_path = strsave(ICON_PATH);
  1181. X       for (p = icon_path; *p; ) {
  1182. X          if (q = index(p, ':'))
  1183. X             *q = '\0';
  1184. X          strcpy(new_path, p);
  1185. X          strcat(new_path, "/");
  1186. X          strcat(new_path, path);
  1187. X          if (access(new_path, R_OK) == 0) {
  1188. X             free(icon_path);
  1189. X             return(icon_load_svrim(new_path, message));
  1190. X             }
  1191. X          else if (q != NULL)
  1192. X             p = q + 1;
  1193. X          else
  1194. X             break;
  1195. X          }
  1196. X       free(icon_path);
  1197. X       return(icon_load_svrim(path, message));
  1198. X       }
  1199. X}
  1200. END_OF_FILE
  1201. if test 2086 -ne `wc -c <'load_icon.c'`; then
  1202.     echo shar: \"'load_icon.c'\" unpacked with wrong size!
  1203. fi
  1204. # end of 'load_icon.c'
  1205. fi
  1206. if test -f 'manifest.h' -a "${1}" != "-c" ; then 
  1207.   echo shar: Will not clobber existing file \"'manifest.h'\"
  1208. else
  1209. echo shar: Extracting \"'manifest.h'\" \(1725 characters\)
  1210. sed "s/^X//" >'manifest.h' <<'END_OF_FILE'
  1211. X/************************************************************************/
  1212. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  1213. X/*                                    */
  1214. X/*    Permission to use, copy, modify, and distribute this software    */
  1215. X/*    and its documentation for any purpose and without fee is    */
  1216. X/*    hereby granted, provided that the above copyright notice    */
  1217. X/*    appear in all copies and that both that copyright notice and    */
  1218. X/*    this permission notice appear in supporting documentation, and    */
  1219. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  1220. X/*    used in advertising or publicity pertaining to distribution    */
  1221. X/*    of the software without specific, written prior permission.    */
  1222. X/*    Chuck Musciano and Harris Corporation make no representations    */
  1223. X/*    about the suitability of this software for any purpose.  It is    */
  1224. X/*    provided "as is" without express or implied warranty.  This     */
  1225. X/*    software may not be sold without the prior explicit permission    */
  1226. X/*    of Harris Corporation.                        */
  1227. X/************************************************************************/
  1228. X
  1229. X/************************************************************************/
  1230. X/*                                    */
  1231. X/*    manifest.h    simple manifest constants            */
  1232. X/*                                    */
  1233. X/************************************************************************/
  1234. X
  1235. X#define        TRUE            1
  1236. X#define        FALSE            0
  1237. X
  1238. X#define        PRIVATE            static
  1239. X#define        PUBLIC            extern
  1240. X#define        EXPORT
  1241. X
  1242. X#ifndef    NULL
  1243. X#define        NULL            0
  1244. X#endif
  1245. X
  1246. X#if !defined(ICON_PATH)
  1247. X#define        ICON_PATH        ".:./icons:/usr/local/images:/usr/include/images"
  1248. X#endif
  1249. X
  1250. X#define        strsave(x)        (((x) == NULL)? NULL : (char *) strcpy((char *) malloc(strlen(x) + 1), x))
  1251. X#define        cond_free(x)        ((x)? free(x) : 0)
  1252. X
  1253. XPUBLIC    int    errno;
  1254. XPUBLIC    char    *sys_errlist[];
  1255. END_OF_FILE
  1256. if test 1725 -ne `wc -c <'manifest.h'`; then
  1257.     echo shar: \"'manifest.h'\" unpacked with wrong size!
  1258. fi
  1259. # end of 'manifest.h'
  1260. fi
  1261. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  1262.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  1263. else
  1264. echo shar: Extracting \"'patchlevel.h'\" \(243 characters\)
  1265. sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  1266. X/************************************************************************/
  1267. X/*                                    */
  1268. X/*    Patch        Comments                    */
  1269. X/*      0        Initial release for XView            */
  1270. X/*                                    */
  1271. X/************************************************************************/
  1272. END_OF_FILE
  1273. if test 243 -ne `wc -c <'patchlevel.h'`; then
  1274.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  1275. fi
  1276. # end of 'patchlevel.h'
  1277. fi
  1278. if test -f 'sample.filter' -a "${1}" != "-c" ; then 
  1279.   echo shar: Will not clobber existing file \"'sample.filter'\"
  1280. else
  1281. echo shar: Extracting \"'sample.filter'\" \(2201 characters\)
  1282. sed "s/^X//" >'sample.filter' <<'END_OF_FILE'
  1283. Xdefaults {
  1284. X   beep                 3
  1285. X   flash                yes
  1286. X   open                 no
  1287. X   stamp                yes
  1288. X   good_icon            ""
  1289. X   check_icon           ""
  1290. X   flash_icon           ""
  1291. X   print                "lpr"
  1292. X   log_file             ""
  1293. X   log_before_filtering no
  1294. X   timestamp            10
  1295. X   display              32768
  1296. X   delete               1024
  1297. X}
  1298. Xfilters {
  1299. X   {
  1300. X      match   "su: chuck"
  1301. X      comment "Track myself becoming super user"
  1302. X      ignore  no
  1303. X      beep    0
  1304. X      flash   no
  1305. X      open    no
  1306. X      stamp   yes
  1307. X   }
  1308. X   {
  1309. X      match   "su:"
  1310. X      comment "Get excited about anyone else becoming superuser"
  1311. X      ignore  no
  1312. X      beep    4
  1313. X      flash   no
  1314. X      open    yes
  1315. X      stamp   yes
  1316. X   }
  1317. X   {
  1318. X      match   "Window data lock"
  1319. X      to      "The offending process"
  1320. X      comment "Ignore spurious window system messages"
  1321. X      ignore  yes
  1322. X   }
  1323. X   {
  1324. X      match   "win ioctl number"
  1325. X      comment "Ignore spurious window system messages"
  1326. X      ignore  no
  1327. X      beep    0
  1328. X      flash   no
  1329. X      open    no
  1330. X      stamp   yes
  1331. X   }
  1332. X   {
  1333. X      match   "A tty window"
  1334. X      to      "Its child"
  1335. X      comment "Ignore spurious window system messages"
  1336. X      ignore  no
  1337. X      beep    0
  1338. X      flash   no
  1339. X      open    no
  1340. X      stamp   yes
  1341. X   }
  1342. X   {
  1343. X      match   "Too large a window number"
  1344. X      comment "Ignore spurious window system messages"
  1345. X      ignore  yes
  1346. X   }
  1347. X   {
  1348. X      match   "NFS server"
  1349. X      comment "Track NFS server message"
  1350. X      ignore  no
  1351. X      beep    0
  1352. X      flash   no
  1353. X      open    no
  1354. X      stamp   yes
  1355. X   }
  1356. X   {
  1357. X      match   "yp:"
  1358. X      comment "Track YP server problems"
  1359. X      ignore  no
  1360. X      beep    0
  1361. X      flash   no
  1362. X      open    no
  1363. X      stamp   yes
  1364. X   }
  1365. X   {
  1366. X      match   "/usr/local/frame"
  1367. X      comment "Ignore various noisy Frame messages"
  1368. X      ignore  yes
  1369. X   }
  1370. X   {
  1371. X      match   "starting maker"
  1372. X      to      "maker: Finished"
  1373. X      comment "Ignore various noisy Frame messages"
  1374. X      ignore  yes
  1375. X   }
  1376. X   {
  1377. X      match   "maker:"
  1378. X      comment "Ignore various noisy Frame messages"
  1379. X      ignore  yes
  1380. X   }
  1381. X   {
  1382. X      match   "fmprintdriver.ps: Using"
  1383. X      comment "Ignore various noisy Frame messages"
  1384. X      ignore  yes
  1385. X   }
  1386. X}
  1387. END_OF_FILE
  1388. if test 2201 -ne `wc -c <'sample.filter'`; then
  1389.     echo shar: \"'sample.filter'\" unpacked with wrong size!
  1390. fi
  1391. # end of 'sample.filter'
  1392. fi
  1393. if test -f 'window_misc.c' -a "${1}" != "-c" ; then 
  1394.   echo shar: Will not clobber existing file \"'window_misc.c'\"
  1395. else
  1396. echo shar: Extracting \"'window_misc.c'\" \(3321 characters\)
  1397. sed "s/^X//" >'window_misc.c' <<'END_OF_FILE'
  1398. X/************************************************************************/
  1399. X/*    Copyright 1988-1990 by Chuck Musciano and Harris Corporation    */
  1400. X/*                                    */
  1401. X/*    Permission to use, copy, modify, and distribute this software    */
  1402. X/*    and its documentation for any purpose and without fee is    */
  1403. X/*    hereby granted, provided that the above copyright notice    */
  1404. X/*    appear in all copies and that both that copyright notice and    */
  1405. X/*    this permission notice appear in supporting documentation, and    */
  1406. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  1407. X/*    used in advertising or publicity pertaining to distribution    */
  1408. X/*    of the software without specific, written prior permission.    */
  1409. X/*    Chuck Musciano and Harris Corporation make no representations    */
  1410. X/*    about the suitability of this software for any purpose.  It is    */
  1411. X/*    provided "as is" without express or implied warranty.  This     */
  1412. X/*    software may not be sold without the prior explicit permission    */
  1413. X/*    of Harris Corporation.                        */
  1414. X/************************************************************************/
  1415. X
  1416. X/************************************************************************/
  1417. X/*                                    */
  1418. X/*    window_misc.c    miscellaneous window management functions    */
  1419. X/*                                    */
  1420. X/************************************************************************/
  1421. X
  1422. X#include    <stdio.h>
  1423. X#include    <sys/param.h>
  1424. X#include    <sys/types.h>
  1425. X#include    <xview/xview.h>
  1426. X#include    <xview/panel.h>
  1427. X#include    <xview/xv_xrect.h>
  1428. X
  1429. X#include    "manifest.h"
  1430. X#include    "contool_ui.h"
  1431. X
  1432. X/************************************************************************/
  1433. XEXPORT    void    pinned_menu_notify(menu, item)
  1434. X
  1435. XMenu        menu;
  1436. XMenu_item    item;
  1437. X
  1438. X{    Xv_opaque    pin_window     = (Xv_opaque) xv_get(menu, MENU_PIN_WINDOW);
  1439. X    void        (*menu_notify)() = (void (*)()) xv_get(menu, MENU_GEN_PROC);
  1440. X    void        (*item_notify)() = (void (*)()) xv_get(item, MENU_GEN_PROC);
  1441. X    
  1442. X    if (pin_window && xv_get(pin_window, XV_SHOW)) {
  1443. X       if (menu_notify)
  1444. X          (*menu_notify)(menu, MENU_NOTIFY);
  1445. X       if (item_notify)
  1446. X          (*item_notify)(item, MENU_NOTIFY);
  1447. X       if (item_notify)
  1448. X          (*item_notify)(item, MENU_NOTIFY_DONE);
  1449. X       if (menu_notify)
  1450. X          (*menu_notify)(menu, MENU_NOTIFY_DONE);
  1451. X    }
  1452. X}
  1453. X
  1454. X/************************************************************************/
  1455. XEXPORT    Panel_setting    file_completion(item, event)
  1456. X
  1457. XPanel_item    item;
  1458. XEvent        *event;
  1459. X
  1460. X{    char    *p, *expand_filename();
  1461. X
  1462. X    switch (event_action(event)) {
  1463. X       case '\n' :
  1464. X       case '\r' :
  1465. X       case ' '  : if ((p = expand_filename(xv_get(item, PANEL_VALUE))) == NULL)
  1466. X                 window_bell(xv_get(item, XV_OWNER));
  1467. X                  else
  1468. X                     xv_set(item, PANEL_VALUE, p, 0);
  1469. X                  return(PANEL_NONE);
  1470. X       default   : return(panel_text_notify(item, event));
  1471. X       }
  1472. X}
  1473. X
  1474. X/************************************************************************/
  1475. XEXPORT    void    place_dialog(base, dialog)
  1476. X
  1477. XXv_opaque    base;
  1478. XXv_opaque    dialog;
  1479. X
  1480. X{    Rect    br, dr, sr;
  1481. X
  1482. X    sr = *((Rect *) xv_get(base, WIN_SCREEN_RECT));
  1483. X    frame_get_rect(base, &br);
  1484. X    frame_get_rect(dialog, &dr);
  1485. X    if (rect_right(&br) + dr.r_width < sr.r_width) {
  1486. X       dr.r_left = rect_right(&br);
  1487. X       dr.r_top = br.r_top;
  1488. X       }
  1489. X    else if (dr.r_width <= br.r_left) {
  1490. X       dr.r_left = br.r_left - dr.r_width;
  1491. X       dr.r_top = br.r_top;
  1492. X       }
  1493. X    else {
  1494. X       dr.r_left = br.r_left + 32;
  1495. X       dr.r_top = br.r_top + 32;
  1496. X       }
  1497. X    frame_set_rect(dialog, &dr);
  1498. X}
  1499. END_OF_FILE
  1500. if test 3321 -ne `wc -c <'window_misc.c'`; then
  1501.     echo shar: \"'window_misc.c'\" unpacked with wrong size!
  1502. fi
  1503. # end of 'window_misc.c'
  1504. fi
  1505. echo shar: End of archive 1 \(of 6\).
  1506. cp /dev/null ark1isdone
  1507. MISSING=""
  1508. for I in 1 2 3 4 5 6 ; do
  1509.     if test ! -f ark${I}isdone ; then
  1510.     MISSING="${MISSING} ${I}"
  1511.     fi
  1512. done
  1513. if test "${MISSING}" = "" ; then
  1514.     echo You have unpacked all 6 archives.
  1515.     rm -f ark[1-9]isdone
  1516. else
  1517.     echo You still need to unpack the following archives:
  1518.     echo "        " ${MISSING}
  1519. fi
  1520. ##  End of shell archive.
  1521. exit 0
  1522.  
  1523. Chuck Musciano                ARPA  : chuck@trantor.harris-atd.com
  1524. Harris Corporation             Usenet: ...!uunet!x102a!trantor!chuck
  1525. PO Box 37, MS 3A/1912            AT&T  : (407) 727-6131
  1526. Melbourne, FL 32902            FAX   : (407) 729-2537
  1527.  
  1528. A good newspaper is never good enough,
  1529.     but a lousy newspaper is a joy forever.        -- Garrison Keillor
  1530.  
  1531. dan
  1532. ----------------------------------------------------
  1533. O'Reilly && Associates   argv@sun.com / argv@ora.com
  1534. Opinions expressed reflect those of the author only.
  1535.